<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Contacts extends CI_Controller {
    public function __construct() {
        parent::__construct();
        $this->load->helper('url');
        $this->load->library('session');
    }
    public function index() {
        if($this->session->userdata('barangay_id') != '' || $this->session->userdata('barangay_id') != null) {
            $this->load->model('Contacts_model');
            $data['contacts'] = $this->Contacts_model->getAll();
            $this->load->view('contacts_index', $data);
        } else {
            header('Location: ' . base_url());
        }
    }
         
}